/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package br.ufrn.generativemodel.generativemodel.impl;

import br.ufrn.generativemodel.generativemodel.Feature;
import br.ufrn.generativemodel.generativemodel.FeatureData;
import br.ufrn.generativemodel.generativemodel.GenerativemodelPackage;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Feature Data</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link br.ufrn.generativemodel.generativemodel.impl.FeatureDataImpl#getFeaturesData <em>Features Data</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class FeatureDataImpl extends EObjectImpl implements FeatureData {
	/**
	 * The cached value of the '{@link #getFeaturesData() <em>Features Data</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFeaturesData()
	 * @generated
	 * @ordered
	 */
	protected EList<Feature> featuresData;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected FeatureDataImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return GenerativemodelPackage.Literals.FEATURE_DATA;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Feature> getFeaturesData() {
		if (featuresData == null) {
			featuresData = new EObjectContainmentEList<Feature>(Feature.class, this, GenerativemodelPackage.FEATURE_DATA__FEATURES_DATA);
		}
		return featuresData;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case GenerativemodelPackage.FEATURE_DATA__FEATURES_DATA:
				return ((InternalEList<?>)getFeaturesData()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case GenerativemodelPackage.FEATURE_DATA__FEATURES_DATA:
				return getFeaturesData();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case GenerativemodelPackage.FEATURE_DATA__FEATURES_DATA:
				getFeaturesData().clear();
				getFeaturesData().addAll((Collection<? extends Feature>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case GenerativemodelPackage.FEATURE_DATA__FEATURES_DATA:
				getFeaturesData().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case GenerativemodelPackage.FEATURE_DATA__FEATURES_DATA:
				return featuresData != null && !featuresData.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //FeatureDataImpl
